home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / libnet-dbus-perl / examples / dump-object-xml.pl next >
Encoding:
Perl Script  |  2008-02-20  |  393 b   |  24 lines

  1. #!/usr/bin/perl
  2.  
  3. use warnings;
  4. use strict;
  5.  
  6. use Net::DBus;
  7. use Net::DBus::Dumper;
  8. use Carp qw(confess);
  9.  
  10. $SIG{__DIE__} = sub {confess $_[0] };
  11.  
  12. my $bus = Net::DBus->find;
  13.  
  14. if (int(@ARGV) != 2) {
  15.     die "syntax: $0 SERVICE OBJECT";
  16. }
  17.  
  18. my $service = $bus->get_service(shift @ARGV);
  19. my $object = $service->get_object(shift @ARGV);
  20. my $xml = $object->_introspector->format();
  21. print $xml, "\n";
  22.  
  23.  
  24.